From 0f788ab1bee03430f426c595c0482d54cf35e943 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 14 May 2014 04:52:55 +0200 Subject: [PATCH] testsuite: Add rtl icontheme tests --- testsuite/gtk/Makefile.am | 3 ++ .../icons/scalable/everything-justrtl-rtl.svg | 11 ++++++ .../gtk/icons/scalable/everything-rtl.svg | 5 +++ .../scalable/everything-symbolic-rtl.svg | 5 +++ testsuite/gtk/icontheme.c | 38 +++++++++++++++++++ 5 files changed, 62 insertions(+) create mode 100644 testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg create mode 100644 testsuite/gtk/icons/scalable/everything-rtl.svg create mode 100644 testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am index 927241ca3b..615c9fc1ae 100644 --- a/testsuite/gtk/Makefile.am +++ b/testsuite/gtk/Makefile.am @@ -129,6 +129,9 @@ test_icontheme = \ icons/16x16/simple.png \ icons/index.theme \ icons/scalable/everything-justregular.svg \ + icons/scalable/everything-justrtl-rtl.svg \ + icons/scalable/everything-rtl.svg \ + icons/scalable/everything-symbolic-rtl.svg \ icons/scalable/everything-justsymbolic-symbolic.svg \ icons/scalable/everything.svg \ icons/scalable/everything-symbolic.svg \ diff --git a/testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg b/testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg new file mode 100644 index 0000000000..3353c25f4d --- /dev/null +++ b/testsuite/gtk/icons/scalable/everything-justrtl-rtl.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/testsuite/gtk/icons/scalable/everything-rtl.svg b/testsuite/gtk/icons/scalable/everything-rtl.svg new file mode 100644 index 0000000000..d63acbc7ae --- /dev/null +++ b/testsuite/gtk/icons/scalable/everything-rtl.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg b/testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg new file mode 100644 index 0000000000..d63acbc7ae --- /dev/null +++ b/testsuite/gtk/icons/scalable/everything-symbolic-rtl.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/testsuite/gtk/icontheme.c b/testsuite/gtk/icontheme.c index 4e1a7d8126..d4f4783f0a 100644 --- a/testsuite/gtk/icontheme.c +++ b/testsuite/gtk/icontheme.c @@ -368,6 +368,43 @@ test_force_regular (void) "/icons/scalable/everything.svg"); } +static void +test_rtl (void) +{ + assert_icon_lookup ("everything", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_DIR_RTL, + "/icons/scalable/everything-rtl.svg"); + assert_icon_lookup ("everything-symbolic", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_DIR_RTL, + "/icons/scalable/everything-symbolic-rtl.svg"); + + assert_icon_lookup_fails ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + 0); + assert_icon_lookup_fails ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_DIR_LTR); + assert_icon_lookup ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_DIR_RTL, + "/icons/scalable/everything-justrtl-rtl.svg"); + + assert_icon_lookup ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_GENERIC_FALLBACK, + "/icons/scalable/everything.svg"); + assert_icon_lookup ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_LTR, + "/icons/scalable/everything.svg"); + assert_icon_lookup ("everything-justrtl", + SCALABLE_IMAGE_SIZE, + GTK_ICON_LOOKUP_GENERIC_FALLBACK | GTK_ICON_LOOKUP_DIR_RTL, + "/icons/scalable/everything-justrtl-rtl.svg"); +} + int main (int argc, char *argv[]) { @@ -378,6 +415,7 @@ main (int argc, char *argv[]) g_test_add_func ("/icontheme/generic-fallback", test_generic_fallback); g_test_add_func ("/icontheme/force-symbolic", test_force_symbolic); g_test_add_func ("/icontheme/force-regular", test_force_regular); + g_test_add_func ("/icontheme/rtl", test_rtl); return g_test_run(); } -- 2.30.2